import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { DemoResService } from './demo-res.service';
import { CreateDemoReDto } from './dto/create-demo-re.dto';
import { UpdateDemoReDto } from './dto/update-demo-re.dto';

@Controller('demo-res')
export class DemoResController {
  constructor(private readonly demoResService: DemoResService) {}

  @Post()
  create(@Body() createDemoReDto: CreateDemoReDto) {
    return this.demoResService.create(createDemoReDto);
  }

  @Get()
  findAll() {
    return this.demoResService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.demoResService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateDemoReDto: UpdateDemoReDto) {
    return this.demoResService.update(+id, updateDemoReDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.demoResService.remove(+id);
  }
}
